const pwd = process.cwd();
let dotenv = require('dotenv');
dotenv.config('./env'); // 加载环境变量


module.exports = {
	tempFilePath: `${pwd}/app/public/temp`,
	logConfig: {
		flag: true,
		outDir: `${pwd}/app/public/log`,
		level: 'info'
	},
	secret: 'my_secret_biluo',
	db: {
		username: process.env.DB_USERNAME,
		password: process.env.DB_PASSWORD,
		host: process.env.DB_HOST,
		database: process.env.DB_DATABASE,
		dialect: process.env.DB_DIALECT,
		define: {
			// 数据库字段下划线命名，匹配模型驼峰式命名
			underscored: true,
			// 禁用修改表名
			freezeTableName: true
		},
		timezone: '+08:00',
		// 返回的时间格式配置
		dialectOptions: {
			dateStrings: true,
			typeCast: true
		}
	}
}
